import Vue from 'vue';
import Router from 'vue-router';
import EditMyList from '../components/page/system/EditMyList';
import MyList from '../components/page/system/MyList';
import LoginLogs from '../components/page/system/LoginLogs';

Vue.use(Router);

export default new Router({

    routes: [
        {
            path: '/',
            redirect: '/login'
        },
        {
            path: '/',
            component: () => import(/* webpackChunkName: "home" */ '../components/common/Home.vue'),
            meta: { title: '自述文件' },
            children: [
                {
                    path: '/advertisePosition',
                    component: () => import(/* webpackChunkName: "dashboard" */ '../components/page/marketing/advertisePosition.vue'),
                    meta: { title: '广告位置' }
                },
                {
                    path: '/advertise',
                    component: () => import(/* webpackChunkName: "dashboard" */ '../components/page/marketing/advertise.vue'),
                    meta: { title: '广告管理' }
                },
                {
                    path: '/question',
                    component: () => import(/* webpackChunkName: "dashboard" */ '../components/page/marketing/question.vue'),
                    meta: { title: '客户问答' }
                },
                {
                    path: '/couponRecord',
                    component: () => import(/* webpackChunkName: "dashboard" */ '../components/page/coupon/couponRecord.vue'),
                    meta: { title: '优惠券记录' }
                },
                {
                    path: '/maintainRecord',
                    component: () => import(/* webpackChunkName: "dashboard" */ '../components/page/stat/maintainRecord.vue'),
                    meta: { title: '维修记录' }
                }, {
                    path: '/maintainShop',
                    component: () => import(/* webpackChunkName: "dashboard" */ '../components/page/stat/maintainShop.vue'),
                    meta: { title: '维修厂' }
                }, {
                    path: '/coupon',
                    component: () => import(/* webpackChunkName: "dashboard" */ '../components/page/coupon/coupon.vue'),
                    meta: { title: '会员优惠券' }
                }, {
                    path: '/carComment',
                    component: () => import(/* webpackChunkName: "dashboard" */ '../components/page/car/carComment.vue'),
                    meta: { title: '车辆评论' }
                },
                {
                    path: '/carShop',
                    component: () => import(/* webpackChunkName: "dashboard" */ '../components/page/car/carShop.vue'),
                    meta: { title: '代理门店' }
                },
                {
                    path: '/brand',
                    component: () => import(/* webpackChunkName: "dashboard" */ '../components/page/car/brand.vue'),
                    meta: { title: '汽车品牌' }
                },
                {
                    path: '/carConfig',
                    component: () => import(/* webpackChunkName: "dashboard" */ '../components/page/car/carConfig.vue'),
                    meta: { title: '车辆配置' }
                },
                {
                    path: '/order',
                    component: () => import(/* webpackChunkName: "dashboard" */ '../components/page/car/order'),
                    meta: { title: '出租订单' }
                },
                {
                    path: '/carType',
                    component: () => import(/* webpackChunkName: "dashboard" */ '../components/page/car/carType.vue'),
                    meta: { title: '车辆类型' }
                },
                {
                    path: '/car',
                    component: () => import(/* webpackChunkName: "dashboard" */ '../components/page/car/car.vue'),
                    meta: { title: '所有车辆' }
                },
                {
                    path: '/stat1',
                    component: () => import(/* webpackChunkName: "dashboard" */ '../components/page/stat/stat1.vue'),
                    meta: { title: '统计图1' }
                }, {
                    path: '/stat2',
                    component: () => import(/* webpackChunkName: "dashboard" */ '../components/page/stat/stat2.vue'),
                    meta: { title: '用户登录统计' }
                },
                {
                    path: '/stat4',
                    component: () => import(/* webpackChunkName: "dashboard" */ '../components/page/stat/stat4.vue'),
                    meta: { title: '统计图4' }
                },
                {
                    path: '/integration',
                    component: () => import(/* webpackChunkName: "dashboard" */ '../components/page/customer/integration.vue'),
                    meta: { title: '积分记录' }
                },
                {
                    path: '/level',
                    component: () => import(/* webpackChunkName: "dashboard" */ '../components/page/customer/level.vue'),
                    meta: { title: '会员等级' }
                },
                {
                    path: '/client',
                    component: () => import(/* webpackChunkName: "dashboard" */ '../components/page/customer/client.vue'),
                    meta: { title: '会员管理' }
                }, {
                    path: '/operLog',
                    component: () => import(/* webpackChunkName: "dashboard" */ '../components/page/system/operLog.vue'),
                    meta: { title: '操作日志' }
                }, {
                    path: '/user',
                    component: () => import(/* webpackChunkName: "dashboard" */ '../components/page/system/user.vue'),
                    meta: { title: '用户管理' }
                }, {
                    path: '/role',
                    component: () => import(/* webpackChunkName: "dashboard" */ '../components/page/system/role.vue'),
                    meta: { title: '角色管理' }
                }, {
                    path: '/menu',
                    component: () => import(/* webpackChunkName: "dashboard" */ '../components/page/system/menu.vue'),
                    meta: { title: '菜单管理' }
                },
                {
                    path: '/dict',
                    component: () => import(/* webpackChunkName: "dashboard" */ '../components/page/system/Dict.vue'),
                    meta: { title: '数据字典' }
                },
                {
                    path: '/dashboard',
                    component: () => import(/* webpackChunkName: "dashboard" */ '../components/utils/Dashboard.vue'),
                    meta: { title: '首页' }
                },
                {
                    path: '/icon',
                    component: () => import(/* webpackChunkName: "icon" */ '../components/utils/Icon.vue'),
                    meta: { title: '自定义图标' }
                },
                {
                    path: '/tabs',
                    component: () => import(/* webpackChunkName: "tabs" */ '../components/utils/Tabs.vue'),
                    meta: { title: 'Tab选项卡' }
                },
                {
                    // vue-schart组件
                    path: '/charts',
                    component: () => import(/* webpackChunkName: "chart" */ '../components/page/count/BaseCharts.vue'),
                    meta: { title: 'schart图表' }
                },
                {
                    // 拖拽列表组件
                    path: '/drag',
                    component: () => import(/* webpackChunkName: "drag" */ '../components/utils/DragList.vue'),
                    meta: { title: '拖拽列表' }
                },
                {
                    // 拖拽Dialog组件
                    path: '/dialog',
                    component: () => import(/* webpackChunkName: "dragdialog" */ '../components/utils/DragDialog.vue'),
                    meta: { title: '拖拽弹框' }
                },
                {
                    // 国际化组件
                    path: '/i18n',
                    component: () => import(/* webpackChunkName: "i18n" */ '../components/utils/I18n.vue'),
                    meta: { title: '国际化' }
                },
                {
                    path: '/404',
                    component: () => import(/* webpackChunkName: "404" */ '../components/page/exception/404.vue'),
                    meta: { title: '404' }
                },
                {
                    path: '/403',
                    component: () => import(/* webpackChunkName: "403" */ '../components/page/exception/403.vue'),
                    meta: { title: '403' }
                },
                {
                    path: '/editMyList',
                    meta: { title: '修改信息' },
                    component:EditMyList
                },
                {
                    path: '/loginLogs',
                    meta: {title: '登录日志'},
                    component:LoginLogs
                },
                {
                    path: '/myList',
                    meta: { title: '我的主页' },
                    component:MyList
                },
                {
                    path: '/myList/:carId/:clientId',
                    meta: { title: '我的主页' },
                    component:MyList
                }
            ]
        },
        {
            path: '/login',
            component: () => import(/* webpackChunkName: "login" */ '../components/page/Login.vue'),
            meta: { title: '登录' }
        },
        {
            path: '*',
            redirect: '/404'
        }
    ]
});
